package org.nightrunner.d3.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * 
 * 装备分类与装备对应表
 * 
 * @author NightRunner
 * @Date 2012-7-26
 * @version 1.0
 */
@Entity
@Table(catalog = "d3", name = "d3_cte")
public class CTE implements java.io.Serializable {

	private static final long serialVersionUID = -762287306861556637L;

	/**
	 * ID
	 */
	private String id;

	/**
	 *分类
	 */
	private Category category;

	/**
	 *事项
	 */
	private Equipment equipment;

	/**
	 * 排序字段
	 */
	private Integer sort;

	@ManyToOne
	@JoinColumn(name = "category_id", referencedColumnName = "category_id", nullable = false)
	public Category getCategory() {
		return category;
	}

	@Column(name = "sort")
	public Integer getSort() {
		return sort;
	}

	@ManyToOne
	@JoinColumn(name = "equipment_id", referencedColumnName = "equipment_id", nullable = false)
	public Equipment getEquipment() {
		return equipment;
	}

	@Id
	@GeneratedValue(generator = "paymentableGenerator")
	@GenericGenerator(name = "paymentableGenerator", strategy = "uuid")
	@Column(name = "id", length = 32)
	public String getId() {
		return id;
	}

	public CTE() {
	}

	public CTE(String id) {
	}

	/**********************************************************************/

	public void setId(String id) {
		this.id = id;
	}

	public void setCategory(Category category) {
		this.category = category;
	}

	public void setSort(Integer sort) {
		this.sort = sort;
	}

	public void setEquipment(Equipment equipment) {
		this.equipment = equipment;
	}
}